package models

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId     int     `gorm:"type:int(11);not null;comment:用户ID"`
	GoodsId    int     `gorm:"type:int(11);not null;comment:商品ID"`
	OrderSn    string  `gorm:"type:varchar(50);not null;comment:订单编号"`
	OrderPrice float64 `gorm:"type:decimal(10,2);not null;comment:订单价格"`
}

func (o *Order) Create() error {
	return DB.Debug().Create(&o).Error
}
